from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from Objects.RegisterPage import RegisterPage

class RegisterAciton:

    def __init__(self):
        print('----开始注册-----')

    def Register(self,wd,username,email,password,conformpwd,phnumber):
        try:
            register = RegisterPage(wd)
            register.click_registerButton()
            register.input_username(username)
            register.input_email(email)
            register.input_password(password)
            register.input_conform_password(conformpwd)
            register.input_phoneNumber(phnumber)
            register.clickSubmit()
        except Exception as e:
            raise  e


if __name__ == '__main__':
    chromeDriver_path = 'E:\Python\chromedriver.exe'
    options = Options()
    options.add_argument('--start-maximized')
    wd = webdriver.Chrome(executable_path=chromeDriver_path, options=options)
    wd.get('http://www.cherryzqr.top/fsmarket/index.php')

    register = RegisterAciton()
    register.Register(wd,'cherry3','13333333331@163.com','A123456','A123456','13322333322')

